package com.croofr.dao.service;

/**
 * Dialect contains specified description and transformers
 * for persistent type
 * <p/>
 * User: bednar
 * Date: Mar 22, 2010
 * Time: 6:36:51 PM
 */
public interface Dialect
{

    /**
     * Driver class name for persistent service type
     *
     * @return class name of driver
     */
    String getDriverClassName();

    /**
     * Contstruct url to persistent service from passed args
     *
     * @param args necessari for construct url
     * @return connection url to persistent service
     */
    String getConnectionUrl(String... args);

    /**
     * Construct Croofr error code from exception
     *
     * @param exception persistent service exception
     * @return Croofr error code
     */
    String execeptionCode(Exception exception);

    /**
     * KeyGenerator for actual persistent service
     *
     * @return key generator
     */
    KeyGenerator getKeyGenerator();

    /**
     * ValueTransformer for actual persistent service
     *
     * @return value transformer
     */
    ValueTransformer getValueTransformer();

}
